/* This file creates a hypothetical hazard from IMF status duration model 4, 
as if IMF status were always 1, i.e as if the country were always in punishment status */

stset StateDur if particip==1, failure(StateChg) id(IMFid)

gen IMFCPIT=IMFCPIL1
gen IMFCHDCT=IMFCHDCL
gen IMFCHRST=IMFCHRSL
gen IMFstat2=IMFstat
gen IMFQuot2=IMFQuota
gen IMFUSAp2=IMFUSAID 
gen IMFoec2=IMFoecd 
gen IMFUS2=IMFUSODA 
gen IMFde2=IMFdem 
gen IMFPar22=IMFParl2 
gen IMFnum2=IMFnump 
gen IMFPart2=IMFParts 
gen IMFseat2=IMFseatl 
gen IMFpfal2=IMFpfall 
gen IMFrfal2=IMFrfall 
gen IMFCPI62=IMFCPIL6   

/* model 4 */

streg Quota USAID USODA oecd FHdem ParlXel2 numpart Partisan seatlar pfall rfall IMFQuota IMFUSAID IMFoecd IMFUSODA IMFdem IMFParl2 IMFnump IMFParts IMFseatl IMFpfall IMFrfall CPIL1 CPIL6 IMFCPIL1 IMFCPIL6 CHDCL1 IMFCHDCL CHRSL1 IMFCHRSL IMFstat, dist(w) cluster(code) 

replace IMFCPIL1=CPIL1 
replace IMFCHDCL=CHDCL1
replace IMFCHRSL=CHRSL1
replace IMFstat=1
replace IMFQuota=Quota
replace IMFUSAID=USAID 
replace IMFoecd=oecd 
replace IMFUSODA=USODA 
replace IMFdem=FHdem 
replace IMFParl2=ParlXel2  
replace IMFnump=numpart  
replace IMFParts=Partisan  
replace IMFseatl=seatlar  
replace IMFpfall=pfall  
replace IMFrfall=rfall   
replace IMFCPIL6=CPIL6    

stset StateDur, failure(StateChg) id(IMFid)

predict HazRate , haz
gen HazR41=1 
replace HazR41=HazRate if applican==0

replace IMFCPIL1=IMFCPIT 
replace IMFCHDCL=IMFCHDCT
replace IMFCHRSL=IMFCHRST
replace IMFstat=IMFstat2
replace IMFQuota=IMFQuot2
replace IMFUSAID=IMFUSAp2 
replace IMFoecd=IMFoec2 
replace IMFUSODA=IMFUS2 
replace IMFdem=IMFde2 
replace IMFParl2=IMFPar22  
replace IMFnump=IMFnum2  
replace IMFParts=IMFPart2  
replace IMFseatl=IMFseat2  
replace IMFpfall=IMFpfal2  
replace IMFrfall=IMFrfal2   
replace IMFCPIL6=IMFCPI62    

drop IMFCPIT IMFCHDCT IMFCHRST IMFstat2 IMFQuot2 IMFUSAp2 IMFoec2 IMFUS2 IMFde2 IMFPar22 IMFnum2 IMFPart2 IMFseat2 IMFpfal2 IMFrfal2 IMFCPI62             